using System.Data;

namespace DataScripter.Scripting.Processes.Morphs
{
    public abstract class BaseFieldMorphAction : IFieldMorphAction
    {
        public string FieldFilter { get; set; }

        public string FieldName { get; set; }
        public abstract void Apply(DataTable from, DataTable to);
        public abstract void Apply(DataRow from, DataRow to, DataTable fromTable, DataTable targetTable);

        public bool ShouldBeAppliedOnField(string fieldName)
        {
            if (FieldFilter == "*")
                return true;
            return FieldFilter == fieldName;
        }
    }
}